<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        function testName (str) {
            if (str.length <= 8 && str.length >= 6) {
                if (/\_/.test(str)&&/\w+/.test(str)&&/[\u4e00-\u9fa5]/.test(str)) {
                    return true;
                } else{
                    return false;
                }
 
            } else{
                return false;
            }
        }

        console.log(testName('_123你好啊'));
    </script>
</body>
</html>